package com.event.listener.listener;

import com.event.listener.event.RefreashApplicationEvent;
import com.event.listener.event.RefreashEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @author shengtao
 * @Description:
 * @date 2019/06/27 15:47
 */
@Slf4j
@Component
public class EventHandleListener {

    @EventListener
    @Async
    public void onApplicationEvent(RefreashApplicationEvent refreashApplicationEvent) {
        RefreashEvent refreashEvent = (RefreashEvent) refreashApplicationEvent.getSource();
        log.info("=========== 1 ============= reciev event: " +refreashEvent.getName()+ "=========================" );

    }
}
